package top.shen33.yang.controller;

import java.io.File;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.shen33.yang.base.R;
import top.shen33.yang.base.YmlConfig;

/**
 * Created by Administrator on 2018-08-19.
 */
@RestController
@RequestMapping("/image")
public class ImageController {


    @Autowired
    private YmlConfig ymlConfig;

    @RequestMapping("/all")
    public Object all() {

        String imagePath = ymlConfig.getImagePath();
        File dir = new File(imagePath);

        String[] imageList = dir.list();
        return R.ok(imageList);

    }
}
